@extends('admin.layout')
@section('title','首页图片')
@section('body')
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>B类广告图片 </legend>
    </fieldset>
    <img src="{{$banner->image}}" alt="">
    <hr>
    <form action="" method="post" enctype="multipart/form-data">
        <label for="">更换图片</label>
        <input type="file" name="banner">
        {{csrf_field()}}
        <input type="submit" value="修改" class="btn-success btn">
    </form>
    <hr>
    <form action="" method="post">
        <label for="">链接</label>
        {{csrf_field()}}
        <input type="text" name="url" style="width: 500px" class="form-control " value="{{$banner->url}}">
        <input type="submit" value="修改" class="btn-success btn">
    </form>
@endsection
@section('js')

    <script>
        @if(Session::has('message'))
             layer.msg("{{Session::get("message")}}");
        {{Session::forget('message')}}
        @endif


        function content(id){
            var html =$("#content"+id).html();
            document.getElementById('content').innerHTML=html;
            layer.open({
                title:"图文详情",
                offset:'20px',
                anim:'5',
                area:['1200px','800px'],
                resize:true,
                moveOut:true,
                type:1,
                content:$("#content"),
            })
        }

        function del(id) {
            layer.open({
                title:"提示",
                content:'确定删除吗？！<form id="down" method="post" action=""><input type="hidden" name="banner_id" value="'+id+'"><input type="hidden" name="type" value="del">{{csrf_field()}}</form>',
                yes:function () {
                    $("#down").submit();
                }
            })
        }

    </script>

@endsection

